package com.ld.zxw.config;

import java.util.List;
import java.util.Map;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.search.ControlledRealTimeReopenThread;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.ReferenceManager;
import org.apache.lucene.search.highlight.SimpleHTMLFormatter;
import org.apache.lucene.store.FSDirectory;
@SuppressWarnings("all")
public class Config{
	
	//分词器选择
	
	private Analyzer analyzer = null;
	
	private boolean highlight = false;

	//高亮显示
	
	private String[]  highlightConf = new String[]{"<font color='red'>","</font>"};
	
	//	索引根目录
	
	private String  lucenePath = null;

	//	非法字符
	private String  illegalFiltering = null;
	
	//索引目录
	private FSDirectory  directory = null;
	
	//查询
	private List<Map<String, String>>  isQuery = null;
	
	//全部字段
	private List<DefaultObject>  xmlDem = null;
	
	
	public boolean isHighlight() {
		return highlight;
	}

	public void setHighlight(boolean highlight) {
		this.highlight = highlight;
	}


	private SimpleHTMLFormatter simpleHTMLFormatter;
	
	public void setSimpleHTMLFormatter(SimpleHTMLFormatter simpleHTMLFormatter) {
		this.simpleHTMLFormatter = simpleHTMLFormatter;
	}
	public SimpleHTMLFormatter getSimpleHTMLFormatter() {
		return simpleHTMLFormatter;
	}
	
	/**nrt init**/
//    private TrackingIndexWriter trackingIndexWriter = null;
    private ReferenceManager<IndexSearcher> reMgr = null;//类似于Lucene3.x中的NrtManager
    private ControlledRealTimeReopenThread<IndexSearcher> crt = null;
	
	
	private int queryNum = 10;
	

	public int getQueryNum() {
		return queryNum;
	}

	public void setQueryNum(int queryNum) {
		this.queryNum = queryNum;
	}

	public Analyzer getAnalyzer() {
		return analyzer;
	}

	public void setAnalyzer(Analyzer analyzer) {
		this.analyzer = analyzer;
	}




	public String[] getHighlightConf() {
		return highlightConf;
	}

	public void setHighlightConf(String[] highlightConf) {
		this.highlightConf = highlightConf;
	}

	public String getLucenePath() {
		return lucenePath;
	}

	public void setLucenePath(String lucenePath) {
		this.lucenePath = lucenePath;
	}

	public String getIllegalFiltering() {
		return illegalFiltering;
	}

	public void setIllegalFiltering(String illegalFiltering) {
		this.illegalFiltering = illegalFiltering;
	}

	public FSDirectory getDirectory() {
		return directory;
	}

	public void setDirectory(FSDirectory directory) {
		this.directory = directory;
	}

	public List<Map<String, String>> getIsQuery() {
		return isQuery;
	}

	public void setIsQuery(List<Map<String, String>> isQuery) {
		this.isQuery = isQuery;
	}

	public List<DefaultObject> getXmlDem() {
		return xmlDem;
	}

	public void setXmlDem(List<DefaultObject> xmlDem) {
		this.xmlDem = xmlDem;
	}

}
